#include "Shm.hpp"

int main()
{
    SharedMemory shm;
    //创建和挂载
    shm.Create();
    sleep(5);
    shm.Attach();
    sleep(5);

    shm.Printshmid_ds();
    sleep(3);

    //使用
    while(true)
    {
        char c;
        shm.Pop(&c);
        printf("server Get: %c\n", c);
        sleep(1);
    }

    //去挂载和删除
    shm.Detach();
    sleep(3);
    shm.Remove();
    sleep(3);

    return 0;
}